#ifndef GIFLOGICALSCREENDESCRIPTOR_H
#define GIFLOGICALSCREENDESCRIPTOR_H

#include "winggif.h"
#include <QIODevice>
#include <QObject>

namespace WingGif {

class WINGEXPORT GifLogicalScreenDescriptor : public QObject {
  Q_OBJECT
  Q_PROPERTY(int width READ width)
  Q_PROPERTY(int height READ height)
  Q_PROPERTY(bool hasGlobalColorTable READ hasGlobalColorTable)
  Q_PROPERTY(int colorResolution READ colorResolution)
  Q_PROPERTY(bool isGlobalColorTableSorted READ isGlobalColorTableSorted)
  Q_PROPERTY(int globalColorTableSize READ globalColorTableSize)
  Q_PROPERTY(int backgroundColorIndex READ backgroundColorIndex)
  Q_PROPERTY(double pixelAspectRatio READ pixelAspectRatio)

public:
  explicit GifLogicalScreenDescriptor(QIODevice *stream,
                                      QObject *parent = nullptr);

  int width();
  int height();
  bool hasGlobalColorTable();
  int colorResolution();
  bool isGlobalColorTableSorted();
  int globalColorTableSize();
  int backgroundColorIndex();
  double pixelAspectRatio();

private:
  int _width;
  int _height;
  bool _hasGlobalColorTable;
  int _colorResolution;
  bool _isGlobalColorTableSorted;
  int _globalColorTableSize;
  int _backgroundColorIndex;
  double _pixelAspectRatio;
};

} // namespace WingGif

#endif // GIFLOGICALSCREENDESCRIPTOR_H
